import { Link } from 'react-router-dom';
import { connect } from 'dva';
import Loadable from 'react-loadable';

const LoadableComponent = Loadable({
    loader: () => import('components/common/bar'),
    loading: () => <div>Loading......</div>,
});

const Page2 = ({ page2 }) => {
    return <div>
        <LoadableComponent />
        <p>{page2.text}</p>
        <Link to="/"><p>Home</p></Link>
        <br/>
        <Link to="/page1"><p>Page 1</p></Link>
    </div>
}

export default connect(({ page2 }) => ({ page2 }))(Page2);